<% if @show_wrapper %>
<div id="<%= params[:scaffold_id] %>" class="ajax-scaffold">
  <div id="<%= scaffold_content_id(params) %>">
<% end %>
    <div class="ajax-scaffold-header">
      <div class="actions">  
        <% new_params = params.merge(:controller => '/estimates', :action => 'new') %>
        <%= loading_indicator_tag(new_params) %>
        <%= link_to_remote "Create New",
          { :url => new_params,
            :loading => "Element.show('#{loading_indicator_id(new_params)}');" },
          { :href => url_for(new_params), 
			      :class => "create" } %> 		 
      </div>
      <h2>Estimates</h2>
  </div>
  <table cellpadding="0" cellspacing="0">
  <thead>  
    <tr> 
      <%= render :partial => 'column_headings' %>
    </tr> 
  </thead>
  <tbody>
    <tr>
      <td colspan="<%= num_columns %>" class="messages-container">
        <div id="<%= scaffold_messages_id(params) %>">
          <%= render :partial => 'messages' %>
        </div>
        <p id="<%= empty_message_id(params) %>" class="empty-message" <%= " style=\"display:none;\" " if !@estimates.empty? %>>
          No Entries
        </p>      
      </td>
    </tr>
  </tbody>  
  <tbody id="<%= scaffold_tbody_id(params) %>">
    <% if !@estimates.empty? %>
  	  <%= render :partial => 'estimate', :collection => @estimates, :locals => { :hidden => false } %>
    <% end %>
  </tbody>
</table>
<div class="ajax-scaffold-footer">
  <%= render :partial => 'pagination_links', :locals => { :paginator => @paginator } %>
</div>
<% if @show_wrapper %>
</div>
</div>
<script type="text/javascript">
Rico.Corner.round('<%= params[:scaffold_id] %>', {color: '#005CB8', bgColor: '#fff', compact: true});
</script>
<% end %>